﻿using System;
using MugenInjection.Delegates;
using MugenInjection.Interface;

namespace MugenInjection.Syntax.Method
{
    /// <summary>
    /// Specific fluent syntax for type binding.
    /// </summary>
    public interface IMethodUseSyntax : IBindingBuilder
    {
        /// <summary>
        /// Indicates that the service should be use reflection activator for activate instance.
        /// </summary>
        /// <returns>The fluent syntax.</returns>
        IMethodCallbackObjectUseWithSyntax UseReflectionActivator();

#if !NETFX_CORE
        /// <summary>
        /// Indicates that the service should be use emit activator for activate instance.
        /// </summary>
        /// <returns>The fluent syntax.</returns>
        IMethodCallbackObjectUseWithSyntax UseEmitActivator();
#endif
#if !NOEXPRESSION

        /// <summary>
        /// Indicates that the service should be use expression activator for activate instance.
        /// </summary>
        /// <returns>The fluent syntax.</returns>
        IMethodCallbackObjectUseWithSyntax UseExpressionActivator();
#endif

        /// <summary>
        /// Indicates that the service should be use custom activator for activate instance.
        /// </summary>
        /// <param name="activator">The specified <see cref="IActivator"/>.</param>
        /// <returns>The fluent syntax.</returns>
        IMethodCallbackObjectUseWithSyntax UseCustomActivator(IActivator activator);

        /// <summary>
        /// Indicates that the service should be use custom activator for activate instance.
        /// </summary>
        /// <param name="methodActivator">The specified <see cref="Func{TResult}"/>.</param>
        /// <returns>The fluent syntax.</returns>
        IMethodCallbackObjectUseWithSyntax UseCustomActivator(Func<IActivator> methodActivator);
    }

    /// <summary>
    /// Specific fluent syntax for type binding.
    /// </summary>
    public interface IMethodUseSyntax<T> : IBindingBuilder
    {
        /// <summary>
        /// Indicates that the service should be use reflection activator for activate instance.
        /// </summary>
        /// <returns>The fluent syntax.</returns>
        IMethodCallbackObjectUseWithSyntax<T> UseReflectionActivator();

#if !NETFX_CORE
        /// <summary>
        /// Indicates that the service should be use emit activator for activate instance.
        /// </summary>
        /// <returns>The fluent syntax.</returns>
        IMethodCallbackObjectUseWithSyntax<T> UseEmitActivator();
#endif
#if !NOEXPRESSION

        /// <summary>
        /// Indicates that the service should be use expression activator for activate instance.
        /// </summary>
        /// <returns>The fluent syntax.</returns>
        IMethodCallbackObjectUseWithSyntax<T> UseExpressionActivator();
#endif

        /// <summary>
        /// Indicates that the service should be use custom activator for activate instance.
        /// </summary>
        /// <param name="activator">The specified <see cref="IActivator"/>.</param>
        /// <returns>The fluent syntax.</returns>
        IMethodCallbackObjectUseWithSyntax<T> UseCustomActivator(IActivator activator);

        /// <summary>
        /// Indicates that the service should be use custom activator for activate instance.
        /// </summary>
        /// <param name="methodActivator">The specified <see cref="Func{T}"/>.</param>
        /// <returns>The fluent syntax.</returns>
        IMethodCallbackObjectUseWithSyntax<T> UseCustomActivator(Func<IActivator> methodActivator);
    }
}